const cors = require('cors');
const express = require('express');
const app = express();
app.listen(3000, () => console.log('服务启动了'));

// ---------------中间件配置----------------
app.use(cors());
app.use(express.urlencoded({ extended: false }));

// -----------加载路由模块，注册中间件------------
app.use('/api', require('./routers/login'));